package com.example.imeino;

import android.os.Bundle;
import android.provider.Settings;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.widget.Toast;

public class Imei extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_imei);
        
        String deviceId = Settings.System.getString(this.getContentResolver(),Settings.System.ANDROID_ID);
        String MANUFACTURER=android.os.Build.MANUFACTURER;
        String kernelversion=System.getProperty("os.version");
        String Model=android.os.Build.MODEL;
        String android_version=android.os.Build.VERSION.RELEASE;       
     
        Log.i("Device ID="+deviceId+" kernalver="+kernelversion+" Model"+Model+"  Android version="+android_version,"Manufacture="+MANUFACTURER);
        Account[] accounts = AccountManager.get(this).getAccounts();
        String possibleEmail =null;
        
        AccountManager a=AccountManager.get(this.getApplicationContext());
        for (Account account : accounts) {
          // TODO: Check possibleEmail against an email regex or treat
          // account.name as an email address only for certain account.type values.
            possibleEmail =possibleEmail+"-"+ account.name;
         
        }
      
        Log.i("Device detail","detail"+possibleEmail);
        Toast.makeText(this.getBaseContext(), "Hi :: "+possibleEmail, 1000).show();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_imei, menu);
        return true;
    }
    

   
}
